<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">


	<title>北京循一堂健康管理有限公司</title>

	<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="./plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css">
	<link href="./plugins/bootstrap-datepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" href="./css/page.css" />
	<link rel="stylesheet" href="./css/yfwh.css">
</head>


<body class="fixed-left">
	<script src="./js/jquery.min.js"></script>
	<script type="text/javascript">
		$(function () {
			$(".tab").slide({ //切换新闻
				titCell: ".hd li",
				mainCell: ".bd",
				targetCell: ".more li",
				effect: "fade",
				autoPlay: false,
				trigger: "click",
				easing: "linear",
				delayTime: 0
			});

			$(".yylb .tab").slide({ //切换新闻
				titCell: ".hd li",
				mainCell: ".bd",
				targetCell: ".more li",
				effect: "fade",
				autoPlay: false,
				trigger: "click",
				easing: "linear",
				delayTime: 0
			});

		});

		function ScrollImgLeft() {
			var speed = 50;
			var scroll_begin = document.getElementById("scroll_begin");
			var scroll_end = document.getElementById("scroll_end");
			var scroll_div = document.getElementById("scroll_div");
			scroll_end.innerHTML = scroll_begin.innerHTML;

			function Marquee() {
				if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
					scroll_div.scrollLeft -= scroll_begin.offsetWidth;
				else
					scroll_div.scrollLeft++;
			}
			var MyMar = setInterval(Marquee, speed);
			scroll_div.onmouseover = function () {
				clearInterval(MyMar);
			}
			scroll_div.onmouseout = function () {
				MyMar = setInterval(Marquee, speed);
			}
		}
	</script>
	<div class="header">
		<div class="container right-b clearfix">
			<div class="logo fl"><img src="./images/logo.jpg" /></div>

			<div class="center fl">
				<div style="width:96%;height:21px;margin:0 auto;white-space: nowrap;overflow:hidden;" id="scroll_div"
					class="scroll_div">
					<div id="scroll_begin">
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
					</div>
					<div id="scroll_end"></div>
				</div>
				<script type="text/javascript">
					ScrollImgLeft();
				</script>
			</div>

			<div class="data fr clearfix">
				<div class="tx">
					<img src="./images/logo.jpg" alt="" height="50" />
				</div>
				<div class="name">
					<button onclick="">退出登录</button>
					<p>欢迎胡凤亮医生<button onclick="" id="name"></button></p>
				</div>


			</div>
		</div>
	</div>
	<div class="main clearfix">
		<div class="tab fl">
			<!-- <div class="hd nav" id="contentDiv">
                            <ul style="background: url(./images/药方维护.png)">
			                	<li class="nav_01"></li>
			                	<li class="nav_02"></li>
			                	<li class="nav_04"></li>
			                	<li class="nav_05"></li>
			                	<li class="nav_06"></li>
			                	<li class="nav_07"></li>			                              
			                </ul>
						</div> -->

			<div class="bd container">
				<ul class="yfwh">
					<div class="ss">
						<input type="text" name="" id="moreSearch" value="" />
						<button type="button">搜索</button>
					</div>


					<div id="yf">
						<ul id="prescript-ul">


							<div class="add">
								<div class="img"></div>
								<button onclick="" data-toggle="modal" data-target="#eddModel">添加药方</button>
							</div>
						</ul>
					</div>

				</ul>

			</div>
		</div>

	</div>

	<!-- 模态框（Modal） -->
	<div class="modal fade" id="editPwdModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
		aria-hidden="true">
		<div class="modal-dialog" style="margin-top: 160px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						&times;
					</button>
					<h4 class="modal-title" id="myModalLabel1">
						查看药方
					</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="editForm">
						<div class="form-group">
							<label for="org_orgName" class="col-sm-2 control-label" style="width: 18%">药方名称：</label>
							<div class="col-sm-10">
								<textarea rows="3" cols="20" disabled></textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label" style="width: 18%">功能主治：</label>
							<div class="col-sm-101">
								<textarea rows="3" cols="20" disabled></textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label"
								style="width: 18%">药&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp方：</label>
							<div class="col-sm-102">
								<ul>
									<li class="col-sm-102-li1">药品名称</li>
									<li class="col-sm-102-li2">规格</li>
									<li class="col-sm-102-li3">数量</li>
									<li class="col-sm-102-li4">备注</li>
								</ul>
								<ul class="yfwhyfsr">
									<li>
										<textarea class="col-sm-102-textarea1" rows="3" cols="20" disabled></textarea>
										<textarea class="col-sm-102-textarea2" rows="3" cols="20" disabled></textarea>
										<textarea class="col-sm-102-textarea3" rows="3" cols="20" disabled></textarea>
										<textarea class="col-sm-102-textarea4" rows="3" cols="20" disabled></textarea>
									</li>
								</ul>
							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label" style="width: 18%">用法用量：</label>
							<div class="col-sm-103">

								<ul>
									<li class="col-sm-102-li1">用法</li>
									<li class="col-sm-102-li2">用量</li>
									<li class="col-sm-102-li3">疗程</li>
									<li class="col-sm-102-li4">类型</li>
								</ul>
								<select disabled="disabled" style="background-color:#ebebe4">
									<option value="">饭后服用</option>
									<option value="">水煎餐后服用</option>
									<option value=""></option>
									<option value=""></option>
								</select>
								<textarea class="col-sm-102-textarea2" rows="3" cols="20" disabled></textarea>
								<textarea class="col-sm-102-textarea3" rows="3" cols="20" disabled></textarea>
								<textarea class="col-sm-102-textarea4" rows="3" cols="20" disabled></textarea>
							</div>
						</div>
					</form>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="yfwhsave()" id="btn1">
						保存
					</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
	<!-- 模态框（Modal） -->
	<div class="modal fade" id="eddModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"
		aria-hidden="true">
		<div class="modal-dialog" style="margin-top: 160px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						&times;
					</button>
					<h4 class="modal-title" id="myModalLabel1">
						编辑药方
					</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="editForm">
						<div class="form-group">
							<label for="org_orgName" class="col-sm-2 control-label" style="width: 18%">药方名称：</label>
							<div class="col-sm-10">
								<textarea rows="3" cols="20" ></textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label" style="width: 18%">功能主治：</label>
							<div class="col-sm-101">
								<textarea rows="3" cols="20" ></textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label"
								style="width: 18%">药&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp方：</label>
							<div class="col-sm-102">
								<ul>
									<li class="col-sm-102-li1">药品名称</li>
									<li class="col-sm-102-li2">规格</li>
									<li class="col-sm-102-li3">数量</li>
									<li class="col-sm-102-li4">备注</li>
									<li class="col-sm-102-li5">
										<button type="button" id="yfwhaddbtn1">
											<img src="./images/yfwhadd.png" alt="">
										</button>
									</li>
								</ul>
								<ul class="yfwhyfsr1">
									<li>
										<textarea class="col-sm-102-textarea1" rows="3" cols="20" ></textarea>
										<textarea class="col-sm-102-textarea2" rows="3" cols="20" ></textarea>
										<textarea class="col-sm-102-textarea3" rows="3" cols="20" ></textarea>
										<textarea class="col-sm-102-textarea4" rows="3" cols="20" ></textarea>
									</li>
								</ul>
								<script type="text/javascript">
									$(document).ready(function () {
										$("#yfwhaddbtn1").click(function () {
											$(".yfwhyfsr1").append(
												'<li>' +
												'<textarea class="col-sm-102-textarea1" rows="3" cols="20" disabled></textarea>' +
												'<textarea class="col-sm-102-textarea2" rows="3" cols="20" disabled></textarea>' +
												'<textarea class="col-sm-102-textarea3" rows="3" cols="20" disabled></textarea>' +
												'<textarea class="col-sm-102-textarea4" rows="3" cols="20" disabled></textarea>' +
												'<button type="button" class="yfwhdeletebtn1"><img src="./images/yfwhdelete.png" alt=""></button>' +
												'</li>'
											);
											$(".yfwhdeletebtn1").click(function () {
												$(this).parent('li').remove();

											});
										});

									});
								</script>

							</div>
						</div>
						<div class="form-group">
							<label for="org_isUse" class="col-sm-2 control-label" style="width: 18%">用法用量：</label>
							<div class="col-sm-103">
								<ul>
									<li class="col-sm-102-li1">用法</li>
									<li class="col-sm-102-li2">用量</li>
									<li class="col-sm-102-li3">疗程</li>
									<li class="col-sm-102-li4">类型</li>
								</ul>
								<select style="background-color:#ebebe4">
									<option value="">饭后服用</option>
									<option value="">水煎餐后服用</option>
									<option value=""></option>
									<option value=""></option>
								</select>
								<textarea class="col-sm-102-textarea2" rows="3" cols="20" ></textarea>
								<textarea class="col-sm-102-textarea3" rows="3" cols="20" ></textarea>
								<textarea class="col-sm-102-textarea4" rows="3" cols="20" ></textarea>
							</div>
						</div>
					</form>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="yfwhsave()" id="btn1">
						保存
					</button>
				
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>


	<!-- 模态框（Modal） -->
	<div class="modal fade" id="delModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"
		aria-hidden="true">
		<div class="modal-dialog" style="margin-top: 160px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						&times;
					</button>
					<h4 class="modal-title" id="myModalLabel1">
						删除药方
					</h4>
				</div>
				<div class="modal-body">
						<div class="form-group">
							确定要删除此药方吗?
						</div>					
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" class="btn btn-primary" data-dismiss="modal" >
						确定
					</button>
				
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>

	<br>
	<br>
	<br>
	<br>
	<br>
	<div class="footer" style="left:0px">
		<p>版权所有 © 2018-2020 北京循一堂健康管理有限公司&nbsp;&nbsp;&nbsp;技术支持电话：010-62084321</p>
	</div>
	<script>
		var resizefunc = [];
	</script>

	<!-- jQuery  -->
	<script src="./js/bootstrap.min.js"></script>
	<script src="./plugins/select/js/bootstrap-select.min.js"></script>

	<script src="./plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="./plugins/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>

	<script src="./plugins/bootstrap-datepicker/js/moment.js"></script>
	<script src="./plugins/bootstrap-datepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script src="./js/jquery.SuperSlide.2.1.1.js" type="text/javascript" charset="utf-8"></script>

	<script type="text/javascript">
		window.baseUrl = localStorage.getItem("baseUrl");
		window.moreSearch = "";
		window.sessionid = localStorage.getItem("sessionid");
		var doctorId = localStorage.getItem("doctorId");
		jQuery(document).ready(function ($) {

			$('#contentDiv').find('li').each(function () {
				$(this).click(function () {
					var index = $(this).index();
					if (index == 0) {
						window.location.href = "patientlibrary.html";
					} else if (index == 1) {
						window.location.href = "appointlist.html";
					} else if (index == 2) {
						window.location.href = "workplan.html";
					} else if (index == 3) {
						window.location.href = "usercenter.html";
					} else if (index == 4) {
						window.location.href = "medicalservice.html";
					} else if (index == 5) {
						window.location.href = "./im/main.html";
					} else if (index == 7) {

					} else if (index == 8) {

					} else if (index == 9) {

					}
				})
			});

			$.ajax({
				type: "POST",
				url: window.baseUrl + "/xunyitang/westPrescript/prescriptlist?jsessionid="+window.sessionid,
				contentType: "application/x-www-form-urlencoded",
				data: {
					doctorId: doctorId
				},
				dataType: "json",
				async: false,
				beforeSend: function (request) {
					request.setRequestHeader("Token", localStorage.getItem("Authorization"));
				},
				success: function (data) {
					console.log(data);
					if (null != data && null != data.rows) {
						for(var i=0;i<data.rows.length;i++){
							var prescript=data.rows[i];
							$("#prescript-ul").before('<li><p>'+prescript.name+'</p><img src="images/yp_b.jpg" alt="" /><div class="yf-btn"><button class="yf-ck view-prescript-btn"></button><button class="yf-bj edit-prescript-btn"></button><button onclick="" class="yf-sc delete-prescript-btn"></button></div></li>');
							$(".view-prescript-btn").click(function(){
								$("#editPwdModel").modal('show');
							});
							$(".edit-prescript-btn").click(function(){
								$("#eddModel").modal('show');
							});

							$(".delete-prescript-btn").click(function(){
								$("#delModel").modal('show');
							});
						}
						
					}
				},
				error: function (data) {
					window.location.href="index.html";
				}
			});

			$('#datetimepicker').datetimepicker({
				format: "YYYY-MM-DD HH:MM:SS"
			});

			$("#btn_more_query").click(function () {
				window.moreSearch = $("#moreSearch").val();
			});
		});
	</script>
</body>

</html>